<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .main-container {
            max-width: 500px;
            height: 500px;
            margin: 0 auto;
            margin-top: 40px;
            overflow: auto;
            margin-top: 20px;
        }
        
        .main-header {
            height: 50px;
            border: 5px solid red;
        }
        
        .main-content {
            min-height: 600px;
            border: 5px solid green;
            margin-top: 20px;
        }
        
        .main-footer {
            border: 5px solid blue;
            margin-top: 20px;
        }
        
        .main-header {
            position: sticky;
            top: 0;
        }
    </style>
</head>

<body>
    <main class="main-container">
        <header class="main-header">HEADER</header>
        <div class="main-content">MAIN CONTENT</div>
        <footer class="main-footer">FOOTER</footer>
    </main>
    <div class="devide"></div>
</body>

</html>
